package model;

import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ClientGroup {
	private static final Logger logger = Logger.getLogger(ClientGroup.class.getName());
	public HashMap<String, Client> clientMap;
	public ClientGroup(){
		this.clientMap=new HashMap<String,Client>();
	}
	public void addChannel(Client client)
	{
		clientMap.put(client.getTaskno(), client);
	}
	public Client getChannel(String taskno)
	{
		return clientMap.get(taskno);
	}
	public void removeChannel(String taskno)
	{
		logger.log(Level.INFO, "删除客户端队列中的"+taskno);
		clientMap.remove(taskno);
	}
	public boolean hasChannel(String taskno)
	{
		return clientMap.containsKey(taskno);
	}
	public HashMap<String, Client> getClientMap() {
		return clientMap;
	}
	public void setClientMap(HashMap<String, Client> clientMap) {
		this.clientMap = clientMap;
	}
	
}
